package sharedGameLogic.players;

import java.io.Serializable;

/**
 * BattleStatus describes a game characters 
 * capabilities in battle such as attack strength,
 * attack speed or health points.
 * 
 * @author Tobias
 *
 */
public final class BattleStatus implements Serializable, Cloneable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -5630833422373497043L;
	//How strong physical attacks a character can make
	private int attackStrength;
	//How fast physical attacks a character can make
	private int attackSpeed;
	//How precise/skilled attacks a character can make
	private int attackPrecision;
	//How good a character is at avoiding the opponents attacks
	private int dodge;
	//How much damage a character can reduce from an opponent attack
	private int block;
	//How strong magical attacks a character can make
	private int magicalStrength;
	//How precise/skilled attacks a character can make
	private int magicalPrecision;
	
	//Characters current health
	private int health;
	//Characters current energy (for magical actions) 
	private int energy;
	
	/**
	 * Constructor for the BattleStatus class.
	 * 
	 * @param atStr - Attack Strength
	 * @param atSpe - Attack Speed
	 * @param atPre - Attack Precision
	 * @param dod - Dodge
	 * @param blo - Block
	 * @param mStr - Magical Strength
	 * @param mPre - Magical Precision
	 * @param hp - Health
	 * @param en - Energy
	 */
	public BattleStatus(int atStr, int atSpe, int atPre, int dod, int blo, 
						int mStr, int mPre, int hp, int en){
		
		attackStrength = atStr;
		attackSpeed = atSpe;
		attackPrecision = atPre;
		dodge = dod;
		block = blo;
		magicalStrength = mStr;
		magicalPrecision = mPre;
		health = hp;
		energy = en;
	}
	
	/**
	 * Accessor for a characters attack strength.
	 * @return Characters maximum attack strength
	 */
	public int getAttackStrength() {
		return attackStrength;
	}
	
	/**
	 * Accessor for a characters attack speed
	 * @return Characters maximum attack speed
	 */
	public int getAttackSpeed() {
		return attackSpeed;
	}
	
	/**
	 * Accessor for a characters attack precision
	 * @return Characters maximum attack precision
	 */
	public int getAttackPrecision() {
		return attackPrecision;
	}
	
	/**
	 * Accessor for a characters dodge value
	 * @return Characters maximum dodge value
	 */
	public int getDodge() {
		return dodge;
	}
	
	/**
	 * Accessor for a characters block value
	 * @return Characters maximum block value
	 */
	public int getBlock() {
		return block;
	}
	
	/**
	 * Accessor for a characters magical attack strength
	 * @return Characters maximum magical attack strength
	 */
	public int getMagicalStrength() {
		return magicalStrength;
	}

	/**
	 * Accessor for a characters magical attack precision
	 * @return Characters maximum magical attack precision
	 */
	public int getMagicalPrecision() {
		return magicalPrecision;
	}
	
	/**
	 * Accessor for a characters current health
	 * @return Characters current health
	 */
	public int getHealth() {
		return health;
	}
	
	/**
	 * Accessor for a characters current energy
	 * @return Characters current energy
	 */
	public int getEnergy() {
		return energy;
	}
	
	/**
	 * Mutator for a characters health
	 * @param newHealth - Characters new health
	 */
	public void setHealth(int newHealth){
		health = newHealth;
	}
	
	/**
	 * Mutator for a characters health
	 * @param newEnergy - Characters new energy
	 */
	public void setEnergy(int newEnergy){
		energy = newEnergy;
	}
	
	@Override
	public Object clone(){
		return new BattleStatus(attackStrength,
								attackSpeed,
								attackPrecision,
								dodge,
								block,
								magicalStrength,
								magicalPrecision,
								health,
								energy);
	}
}
